package com.example.designpatterns.Interpreter;

/**
 * 测试类
 */
public class Client {

    public static void main(String[] args) {
        System.out.println("result: " + new Calculator().parse("10 + 30 - 20"));
        System.out.println("result: " + new SubExpression(new AddExpression(new NumExpression(10), new NumExpression(30)), new NumExpression(20)).interpret());
    }

}

